package com.sagframe.sagacity.sqltoy.plus.multi.query;

import com.sagframe.sagacity.sqltoy.plus.conditions.eumn.SqlKeyword;
import com.sagframe.sagacity.sqltoy.plus.multi.AbstractStringMultiWrapper;
import com.sagframe.sagacity.sqltoy.plus.multi.MultiContext;
import com.sagframe.sagacity.sqltoy.plus.multi.StringMultiStepWrapper;
import com.sagframe.sagacity.sqltoy.plus.multi.model.StrColumn;

public class MultiQueryWrapper<T> extends AbstractStringMultiWrapper<MultiQueryWrapper<T>> implements StringQuery<MultiQueryWrapper<T>, StrColumn>{

    public MultiQueryWrapper(Class<?> toClass) {
        super(toClass);
        context.addOperateSqlSegment(SqlKeyword.SELECT);
    }

    public MultiQueryWrapper(MultiContext context) {
        super(context);
    }

    @Override
    protected MultiQueryWrapper<T> instance() {
        return new MultiQueryWrapper<>(context);
    }

    @Override
    public StringMultiStepWrapper.LambdaFrom<MultiQueryWrapper<T>> select(StrColumn... columns) {
        context.addSelectSqlAssembler(columns);
        return new StringMultiStepWrapper.MultiStepWrapperBuilder<>(typedThis, context);
    }

    @Override
    public StringMultiStepWrapper.LambdaFrom<MultiQueryWrapper<T>> select(Class<?> mappingClass, StrColumn... columns) {
        context.addSelectSqlAssembler(mappingClass, columns);
        return new StringMultiStepWrapper.MultiStepWrapperBuilder<>(typedThis, context);
    }
}
